package com.zjuee.web.ledger.service.impl.handledata;

import com.zjuee.core.translation.handledata.impl.AbstractDataHandler;
import com.zjuee.vo.PlanInfoVo;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component(value = "planHandle")
public class PlanHandle extends AbstractDataHandler {
    @Override
    public <T> T getData(T data, Map<Object, Object> map, String... str) {
        PlanInfoVo planInfoVo = (PlanInfoVo) data;
        planInfoVo.setBciCityChinese(map.get(planInfoVo.getBciCity() + "" + str[0]) == null ? "" : map.get(planInfoVo.getBciCity() + "" + str[0]).toString());
        planInfoVo.setBciAreaChinese(map.get(planInfoVo.getBciArea() + "" + str[1]) == null ? "" : map.get(planInfoVo.getBciArea() + "" + str[1]).toString());
        planInfoVo.setBciStreetChinese(map.get(planInfoVo.getBciStreet() + "" + str[2]) == null ? "" : map.get(planInfoVo.getBciStreet() + "" + str[2]).toString());
        planInfoVo.setBciTypeChinese(getStr(map, planInfoVo.getBciType(), str, 3));
        planInfoVo.setBciCategoryChinese(map.get(planInfoVo.getBciCategory() + "" + str[4]) == null ? "" : map.get(planInfoVo.getBciCategory() + "" + str[4]).toString());
        planInfoVo.setWpiAuditStatusChinese(map.get(planInfoVo.getWpiAuditStatus() + "" + str[5]) == null ? "" : map.get(planInfoVo.getWpiAuditStatus() + "" + str[5]).toString());

        return (T) planInfoVo;
    }
}
